# Winefish LaTeX Editor
# Makefile.in - the Makefile template
# Copyright (C) 2002 Olivier Sessink
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

top_srcdir = @top_srcdir@
top_builddir = @top_srcdir@
srcdir = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
pkgdatadir = @pkgdatadir@

infodir = $(prefix)/info
libdir = $(prefix)/lib/gnudl
mandir = $(prefix)/man/man1
localedir = @localedir@
gnulocaledir = $(prefix)/share/locale
aliaspath = $(localedir):.

CC = @CC@
CFLAGS = @CFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
INSTALL = @INSTALL@
INSTALL_DIR = $(INSTALL) -d -m 755 
INSTALL_PROGRAM = $(INSTALL) -s -m 755
DEFS = -DLOCALEDIR=\"$(localedir)\" -DGNULOCALEDIR=\"$(gnulocaledir)\" \
-DLOCALE_ALIAS_PATH=\"$(aliaspath)\" -DPKGDATADIR=\"$(pkgdatadir)\" @DEFS@

SRCS = \
about.c \
autox.c \
bf_lib.c \
bfspell.c \
bookmark.c \
brace_finder.c \
char_table.c \
document.c \
filebrowser.c \
fref.c \
func_complete.c \
func_comment.c \
func_delline.c \
func_shift.c \
func_indent.c \
func_move.c \
func_grep.c \
func_zoom.c \
gtk_easy.c \
gui.c \
highlight.c \
html.c \
html_diag.c \
keymap.c \
image.c \
menu.c \
msg_queue.c \
outputbox.c \
outputbox_bf.c \
outputbox_filter.c \
pixmap.c \
preferences.c \
project.c \
rcfile.c \
snooper2.c \
snr2.c \
stringlist.c \
treetips.c \
undo_redo.c \
winefish.c \
wizards.c \


OBJS = $(SRCS:.c=.o)

all: winefish
winefish: $(SRCS) $(OBJS)
	$(CC) $(DEFS) -o winefish $(OBJS) $(LDFLAGS) $(LIBS)
	@echo "The winefish binary is succesfully created"

.c.o: $(SRCS)
	$(CC) $(DEFS) $(CFLAGS) -c -o $@ $<

$(OBJS): bluefish.h

clean:
	rm -f $(OBJS) winefish

patchclean: clean
	rm -f *.orig *.rej  

distclean: patchclean
	rm -f config.h Makefile *~ *.bak core

install: all
	$(INSTALL_DIR) $(DESTDIR)$(bindir)
	$(INSTALL_PROGRAM) ./winefish $(DESTDIR)$(bindir)/winefish

uninstall:
	/bin/rm -f $(DESTDIR)$(bindir)/winefish
